<?php echo $this->render('header.phtml'); ?>
<div id="list">
    <!-- google_ad_section_start -->
    <?php if (count($this->articleList)) : ?>
        <?php foreach ($this->articleList as $articleSet) : ?>
    <div id="article-<?php echo $this->escape($articleSet->article->articleId) ?>" class="article_list">
      <div id="article-title-<?php echo $this->escape($articleSet->article->articleId) ?>" class="article_head">
        <h2>
            <a href="/article/<?php echo $this->escape($articleSet->article->articleId) ?>-1.html" title="链接到  <?php echo $this->escape($articleSet->article->articleTitle) ?>"><?php echo $this->escape($articleSet->article->articleTitle) ?></a>
        </h2>
        <span class="article_info">
            <?php echo $this->escape($articleSet->article->publishTime) ?>
            <a href="/category/<?php echo $this->escape($articleSet->category->categoryId) ?>-1.html" title="查看 <?php echo $this->escape($articleSet->category->categoryName) ?>的全部文章"><?php echo $this->escape($articleSet->category->categoryName) ?></a>
        </span>
      </div>

      <div id="article-summary-<?php echo $this->escape($articleSet->article->articleId) ?>" class="article_summary">
        <?php echo $articleSet->article->articleSummary ?>
        <p id="article-readmore-<?php echo $this->escape($articleSet->article->articleId) ?>" class="article_readmore"> <a href="/article/<?php echo $this->escape($articleSet->article->articleId) ?>-1.html">Read More...</a> </p>
      </div>

      <div id="article-info-<?php echo $this->escape($articleSet->article->articleId) ?>">
        <span class="article_tags">
            <?php foreach ($articleSet->tags as $tag) : ?>
            <a href="/tag/<?php echo $this->escape($tag->tagId) ?>-1.html" rel="tag"><?php echo $this->escape($tag->tagName) ?></a>
            <?php endforeach; ?>
        </span>
        <span class="article_views"><?php echo $this->escape($articleSet->article->clickCount) ?> 人阅读
        <a href="/article/<?php echo $this->escape($articleSet->article->articleId)?>-1.html" title="<?php echo $this->escape($articleSet->article->articleTitle) ?>的评论">
      	<?php if($articleSet->article->commentCount == 0) : ?>
        	抢沙发
        <?php elseif ($articleSet->article->commentCount == 1) : ?>
        	坐板凳
        <?php else : ?>
            <?php echo $this->escape($articleSet->article->commentCount) ?> 条评论
        <?php endif; ?>
        </a>
        </span>
      </div>
    </div>
        <?php endforeach; ?>
        <?php echo $this->paginationControl($this->articleList,'Elastic','pagebar.phtml'); ?>
    <?php endif; ?>
    <!-- google_ad_section_end -->
</div>
<?php echo $this->render('navibar.phtml'); ?>
<?php echo $this->render('sidebar.phtml'); ?>
<?php if (!empty($this->keyword)) : ?>
<script type="text/javascript" src="/public/js/jquery.highlightRegex.js" />
<script type="text/javascript">
    $(function(){
       var keyword = "<?php echo $this->escape($this->keyword) ?>";
       $('#list').highlightRegex();
           if(keyword != '') {
             $('#list').highlightRegex(new RegExp(keyword, 'ig'));
           }
    });
</script>
<?php endif; ?>
<?php echo $this->render('footer.phtml'); ?>